home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Source Code
/
Visual Basic Source Code.iso
/
vbsource
/
crwdemo
/
table.frm
< prev
next >
Wrap
Text File
|
1995-12-05
|
8KB
|
282 lines
VERSION 2.00
Begin Form Tablem
BackColor = &H00C0C0C0&
Caption = "Table Management"
ClientHeight = 6015
ClientLeft = 2460
ClientTop = 1965
ClientWidth = 4485
Height = 6705
Left = 2400
LinkTopic = "Form1"
ScaleHeight = 6015
ScaleWidth = 4485
Top = 1335
Width = 4605
Begin TextBox Text6
Height = 285
Left = 1890
TabIndex = 15
Top = 3375
Width = 2445
End
Begin TextBox Text5
Height = 285
Left = 1890
TabIndex = 14
Top = 3015
Width = 2445
End
Begin TextBox Text4
Height = 420
Left = 2790
TabIndex = 7
Top = 495
Width = 1365
End
Begin CommandButton Command8
Caption = "Number of Tables"
Height = 420
Left = 630
TabIndex = 13
Top = 495
Width = 1995
End
Begin SSPanel StatusBar
Alignment = 1 'Left Justify - MIDDLE
BorderWidth = 1
Height = 555
Left = 0
TabIndex = 12
Top = 5445
Width = 4515
End
Begin CommandButton Command7
Caption = "Help"
Height = 420
Left = 2340
TabIndex = 11
Top = 4860
Width = 1725
End
Begin CommandButton Command6
Caption = "Close"
Height = 420
Left = 450
TabIndex = 10
Top = 4860
Width = 1725
End
Begin CommandButton Command5
Caption = "Set Table Location"
Height = 420
Left = 2430
TabIndex = 9
Top = 4320
Width = 1725
End
Begin CommandButton Command4
Caption = "Get Table Location"
Height = 420
Left = 360
TabIndex = 8
Top = 4320
Width = 1725
End
Begin CommandButton Command3
Caption = "Table Type"
Height = 420
Left = 1710
TabIndex = 6
Top = 2070
Width = 1275
End
Begin CommandButton Command2
Caption = ">>"
Height = 420
Left = 3150
TabIndex = 4
Top = 1530
Width = 915
End
Begin CommandButton Command1
Caption = "<<"
Height = 420
Left = 630
TabIndex = 3
Top = 1530
Width = 915
End
Begin TextBox Text3
Height = 465
Left = 180
TabIndex = 2
Top = 3780
Width = 4155
End
Begin TextBox Text2
Height = 285
Left = 1890
TabIndex = 1
Top = 2655
Width = 2445
End
Begin TextBox Text1
Height = 420
Left = 1710
TabIndex = 0
Top = 1530
Width = 1275
End
Begin Label Label4
BackColor = &H00C0C0C0&
Caption = "Database Type"
Height = 240
Left = 180
TabIndex = 17
Top = 3420
Width = 1455
End
Begin Label Label3
BackColor = &H00C0C0C0&
Caption = "Descriptive Name"
Height = 285
Left = 180
TabIndex = 18
Top = 3015
Width = 1545
End
Begin Label Label2
BackColor = &H00C0C0C0&
Caption = "DLL Name"
Height = 240
Left = 180
TabIndex = 16
Top = 2655
Width = 1275
End
Begin Label Label1
Alignment = 2 'Center
BackColor = &H00C0C0C0&
Caption = "Increment Table Number"
Height = 240
Left = 630
TabIndex = 5
Top = 1125
Width = 3435
End
Begin Menu MenuFile
Caption = "&File"
Begin Menu MenuExit
Caption = "&Exit"
End
End
End
Sub Command1_Click ()
Dim nTables As Integer
If (TableN > 0) Then
TableN = TableN - 1
Text1.Text = TableN
End If
End Sub
Sub Command2_Click ()
Dim nTables As Integer
nTables = PEGetNTables(JobNum)
If nTables = 0 Then
Text1.Text = 0
Else
If (TableN < nTables - 1) Then
TableN = TableN + 1
Text1.Text = TableN
End If
End If
End Sub
Sub Command3_Click ()
Dim TableType As PETableType
TableType.StructSize = Len(TableType)
TableType.DLLName = Chr$(0)
TableType.DescriptiveName = Chr$(0)
'TableType.DBType
If PEGetNthTableType(JobNum, TableN, TableType) = False Then
RCode = GetErrorString(JobNum)
MsgBox "PEGetNthTableType Error #: " + Str(ErrorCode) + " - " + RCode
Else
Tablem!StatusBar.Caption = "Table Type " + Text1.Text + " has been retrieved"
Text2.Text = TableType.DLLName
Text5.Text = TableType.DescriptiveName
Text6.Text = TableType.DBType
End If
End Sub
Sub Command4_Click ()
Dim locInfo As PETableLocation
locInfo.Location = Chr$(0)
locInfo.StructSize = Len(locInfo)
If PEGetNthTableLocation(JobNum, TableN, locInfo) = 1 Then
Text3.Text = locInfo.Location
Tablem!StatusBar.Caption = "Table Location Retrieved"
Else
RCode = GetErrorString(JobNum)
MsgBox "PEGetNthTableLocation Error #: " + Str(ErrorCode) + " - " + RCode
Exit Sub
End If
End Sub
Sub Command5_Click ()
Dim locInfo As PETableLocation
locInfo.StructSize = Len(locInfo)
locInfo.Location = Text3.Text + Chr$(0)
If PESetNthTableLocation(JobNum, TableN, locInfo) = 1 Then
Tablem!StatusBar.Caption = "Table Location Set"
Else
RCode = GetErrorString(JobNum)
MsgBox "PESetNthTableLocation Error #: " + Str(ErrorCode) + " - " + RCode
Exit Sub
End If
End Sub
Sub Command6_Click ()
Unload Me
End Sub
Sub Command7_Click ()
RCode = Shell("Winhelp c:\crw\crw.hlp", 3)
If RCode = False Then
MsgBox ("CRWDEMO cannot find the Crystal Help file in C:\CRW directory")
End If
End Sub
Sub Command8_Click ()
If JobNum = 0 Then
MsgBox "No job open."
Exit Sub
End If
nTables = PEGetNTables(JobNum)
Tablem!StatusBar.Caption = "Number of Tables Retrieved"
Text4.Text = nTables
If nTables > 0 Then
Text1.Text = 0
End If
End Sub
Sub MenuExit_Click ()
Unload Me
End Sub